import unittest,requests


class weidu(unittest.TestCase):
    host="https://10.59.9.18/"
    userId=None
    sessionId=None


    # 登陆
    def test_01(self):
        url=weidu.host+"/techApi/user/v1/login"
        json={'phone':'15136595213','pwd':'UGJYakExdExTMERUbHlkc2lMd3NvK3Y2OHNMZ1l3cDhteldpRTJoREpOZTBKSlFRYmVnOWdNNXpWY2pTOG1vS29JRytqK0g5bldRUUcyZ3VoUHlmT2lLRVgvazRRK3ZIclUvNmhGMkpYV0YwNStyNVdpUXdieXRqdnpxQ1VUZDQ4Um1RYTRMdVJOU0ZxeC8wOWE3Y3poNXE1a1htZEs3RlBKUkNqU1NHcU9FPQ=='}
        r=requests.post(url=url,data=json,verify=False)
        print(r.json())
        weidu.userId=str(r.json()['result']['userId'])
        weidu.sessionId = r.json()['result']['sessionId']
        print(weidu.userId)
        print(weidu.sessionId)

    # 完善用户信息


    def test_02(self):
        url=weidu.host+"/techApi/user/verify/v1/perfectUserInfo"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'nickName':'你的益达','sex':1,'signature':'我的个人签名','birthday':'2022-07-22','email':'3275469007@qq.com'}
        r=requests.post(url=url,params=json,verify=False,headers=headers)
        print(r.json())

    # 修改用户昵称
    def test_04(self):
        url=weidu.host+"/techApi/user/verify/v1/modifyNickName"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'nickName':'辉煌'}
        r=requests.put(url=url,verify=False,params=json,headers=headers)
        print(r.json())

    # 修改用户签名
    def test_05(self):
        url=weidu.host+"/techApi/user/verify/v1/modifySignature"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'signature':'我的最新签名'}
        r=requests.put(url=url,verify=False,params=json,headers=headers)
        print(r.json())

# 修改邮箱
    def test_06(self):
        url=weidu.host+"/techApi/user/verify/v1/modifyEmail"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'email':'3275469007@qq.com'}
        r=requests.put(url=url,verify=False,params=json,headers=headers)
        print(r.json())




# 根据极光userNames批量查询会话列表需要的用户信息
    def test_07(self):
        url=weidu.host+"/techApi/user/verify/v1/findConversationList"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'userNames':'18,19,20'}
        r=requests.get(url=url,verify=False,params=json,headers=headers)
        print(r.json())

# 查询用户积分

    def test_08(self):
        url=weidu.host+"/techApi/user/verify/v1/findUserIntegral"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        r=requests.get(url=url,verify=False,headers=headers)
        print(r.json())

    # 查询用户积分明细
    def test_09(self):
        url=weidu.host+"/techApi/user/verify/v1/findUserIntegral"
        headers={'userId':weidu.userId,'sessionId':weidu.sessionId}
        json={'page':1,'count':5}
        r=requests.get(url=url,verify=False,headers=headers,json=json)
        print(r.json())

    # RSA加密接口（测试同学使用）
    def test_10(self):
        url = weidu.host+'/techApi/tool/v1/encrypt?password=123456'

        json={'password':'123456'}
        r = requests.get(url=url, verify=False, json=json)
        print(r.json())

    # 注册
    def test_11(self):
        url = weidu.host + "/techApi/user/v1/register"
        json = {'phone': '15136595213', 'nickName': '大爱仙尊','pwd': 'T1NOa1NjamMvVXhiYlIvZVptK3ZCSXQzVWhGMzlkT1E2SlQ4Q1NoTlBXaHA3aURaVXlncWVCWVpKR2ErMHpwNTdtVGxVdGN1S24zL2Ivb2M2YXJqUTRscUpYcXFYTzRkdjUxNTc2cFJpemdEbzFoT1A5RGFyeHdtN3V2VlVRNUplSmRSSmoycmU4Z003Q296QWZMT3ZNS1FmbzZtR29XMFpwT0JmcDluazdjPQ=='}
        r = requests.post(url=url, verify=False, params=json)
        print(r.json())

    # 查询用户的好友通知记录

    def test_12(self):
        url = weidu.host+'/techApi/chat/verify/v1/findFriendNoticePageList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'status':0,'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())


    # 审核好友申请
    def test_13(self):
        url = weidu.host+'/techApi/chat/verify/v1/reviewFriendApply'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'noticeId':1,'flag':2}
        r = requests.put(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 用户收藏列表
    def test_14(self):
        url = weidu.host+'/techApi/user/verify/v1/findAllInfoCollection'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 所有板块查询
    bkid=""
    def test_15(self):
        url = weidu.host+'/techApi/information/v1/findAllInfoPlate'
        r = requests.get(url=url, verify=False)
        print(r.json())
        weidu.bkid=r.json()['result'][0]['id']
        print(weidu.bkid)


# 资讯推荐展示列表(包含单独板块列表展示)
    zxid=""
    def test_16(self):
        url = weidu.host+'/techApi/information/v1/infoRecommendList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'plateId':weidu.bkid,'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())
        weidu.zxid=r.json()['result'][0]['id']

# 添加收藏

    def test_17(self):
        url = weidu.host+'/techApi/user/verify/v1/addCollection'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'infoId':weidu.zxid}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

        # 取消收藏（支持批量操作）
    def test_18(self):
        url = weidu.host+'/techApi/user/verify/v1/cancelCollection'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'infoId':weidu.zxid}
        r = requests.delete(url=url, verify=False, params=json,headers=headers)
        print(r.json())
# 用户关注列表
    def test_19(self):
        url = weidu.host+'/techApi/user/verify/v1/findFollowUserList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())


# 关注用户
    def test_20(self):
        url = weidu.host+'/techApi/user/verify/v1/addFollow'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'focusId':weidu.userId}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 取消关注
    def test_21(self):
        url = weidu.host+'/techApi/user/verify/v1/cancelFollow'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'focusId':weidu.userId}
        r = requests.delete(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 校验手机号是否可用
    def test_22(self):
        url = weidu.host+'/techApi/user/v1/checkPhone'
        json={'phone':"15136595213"}
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 绑定微信帐号
    def test_23(self):
        url = weidu.host+'/techApi/user/verify/v1/bindWeChat'
        json={'code':"cccc137900"}
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 判断是否绑定微信
    def test_24(self):
        url = weidu.host+'/techApi/user/verify/v1/whetherToBindWeChat'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())
        # 查询用户任务列表



    # 签到
    def test_27(self):
        url = weidu.host+'/techApi/user/verify/v1/userSign'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}

        r = requests.post(url=url, verify=False,headers=headers)
        print(r.json())

        # 查询当天签到状态
    def test_28(self):
        url = weidu.host+'/techApi/user/verify/v1/findUserSignStatus'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}

        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())

    # 查询用户连续签到天数
    def test_29(self):
        url = weidu.host+'/techApi/user/verify/v1/findContinuousSignDays'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}

        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())

    # 查询用户当月所有签到的日期
    def test_30(self):
        url = weidu.host+'/techApi/user/verify/v1/findUserSignRecording'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}

        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())

    # 创建自定义好友分组
    groupId=""
    def test_31(self):
        url = weidu.host+'/techApi/chat/verify/v1/addFriendGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupName':'a'}
        r = requests.post(url=url, verify=False,headers=headers,data=json)
        print(r.json())
        # weidu.groupId=r.json()['groupId']
        # print(weidu.groupId)

    # 查询分组下的好友列表信息
    def test_32(self):
        url = weidu.host+'/techApi/chat/verify/v1/findFriendListByGroupId'
        headers = {'userId': str(weidu.userId), 'sessionId': weidu.sessionId}
        json={'groupId':weidu.groupId}
        r = requests.get(url=url, verify=False,headers=headers,data=json)
        print(r.json())

    # 查询好友信息
    def test_33(self):
        url = weidu.host+'/techApi/user/verify/v1/queryFriendInformation'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={}
        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())




# 增量查询脸部特征库
    def test_34(self):
        url = weidu.host+'/techApi/user/v1/incrementFindFaceFeature'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False,headers=headers)
        print(r.json())

# 绑定faceId
    def test_35(self):
        url = weidu.host+'/techApi/user/verify/v1/bindingFaceId'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.put(url=url, verify=False,headers=headers)
        print(r.json())



    # 解绑faceId
    def test_37(self):
        url = weidu.host+'/techApi/user/verify/v1/untiedFaceId'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}

        r = requests.delete(url=url, verify=False,headers=headers)
        print(r.json())

    # 绑定手机号并设置密码
    def test_38(self):
        url = weidu.host+'/techApi/user/verify/v1/bindingPhone'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'phone':'15136595213','pwd':'UGJYakExdExTMERUbHlkc2lMd3NvK3Y2OHNMZ1l3cDhteldpRTJoREpOZTBKSlFRYmVnOWdNNXpWY2pTOG1vS29JRytqK0g5bldRUUcyZ3VoUHlmT2lLRVgvazRRK3ZIclUvNmhGMkpYV0YwNStyNVdpUXdieXRqdnpxQ1VUZDQ4Um1RYTRMdVJOU0ZxeC8wOWE3Y3poNXE1a1htZEs3RlBKUkNqU1NHcU9FPQ=='}
        r = requests.post(url=url, verify=False,headers=headers,data=json)
        print(r.json())

    # 登陆2
    userId2=None
    sessionId2=None

    def test_39(self):
        url = weidu.host + "/techApi/user/v1/login"
        json = {'phone': '18825853329','pwd': 'S0hBZElnMkExQml6T21vYVRacVNmN2lSRHUxNGVsK2JMSXlBUkpWSmJsM0JJYkN0M0RYaTZLMDh0N3pLSU1FYzgvR1FFZzhZMExYaXFqNWE1WlBiUGd4bWdYWFVvZ09VTzdYcmpZOUZRRStqUkhqN1RVc25GSDJvaWp1STI3Tm1WdWpDdlRZTUpGVit5WGRMOTZlZlY3eTlKWVJENzlIdzlPN2xNMWQ5eUEwPQ=='}
        r = requests.post(url=url, data=json, verify=False)
        print(r.json())
        weidu.userId2 = r.json()['result']['userId']
        weidu.sessionId2 = r.json()['result']['sessionId']
        print(weidu.userId2)
        print(weidu.sessionId2)

# 添加好友
    def test_40(self):
        url = weidu.host+'/techApi/chat/verify/v1/addFriend'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'friendUid':weidu.userId2,'remark':'我是彭于晏'}
        r = requests.post(url=url, verify=False,headers=headers,data=json)
        print(r.json())

    # 删除好友

    def test_41(self):
        url = weidu.host+'/techApi/chat/verify/v1/deleteFriendRelation'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'friendUid':weidu.userId2}
        r = requests.delete(url=url, verify=False,headers=headers,params=json)
        print(r.json())

    # 修改好友备注
    def test_42(self):
        url = weidu.host+'/techApi/chat/verify/v1/modifyFriendRemark'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'friendUid':weidu.userId2,'remarkName':'小明'}
        r = requests.put(url=url, verify=False,headers=headers,params=json)
        print(r.json())

    # 检测是否为我的好友
    def test_43(self):
        url = weidu.host+'/techApi/chat/verify/v1/checkMyFriend'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'friendUid':weidu.userId2}
        r = requests.get(url=url, verify=False,headers=headers,params=json)
        print(r.json())

    # 创建自定义好友分组

    def test_44(self):
        url = weidu.host+'/techApi/chat/verify/v1/addFriendGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupName':"八维1"}
        r = requests.post(url=url, verify=False,headers=headers,params=json)
        print(r.json())

# 查询我的好友列表
    def test_52(self):
        url = weidu.host + '/techApi/chat/verify/v1/searchFriend'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'searchName': "张"}
        r = requests.get(url=url, verify=False, headers=headers, params=json)
        print(r.json())

    # 初始化我的好友列表全量信息
    def test_53(self):
        url = weidu.host + '/techApi/chat/verify/v1/initFriendList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False, headers=headers)
        print(r.json())

    # 创建群
    def test_54(self):
        url = weidu.host + '/techApi/group/verify/v1/createGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'name':'FASDF','description':'欢迎各位加群'}
        r = requests.post(url=url, verify=False, headers=headers,data=json)
        print(r.json())

    # 查询我创建的群组
    def test_55(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupsByUserId'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False, headers=headers)
        print(r.json())

# 修改群组名

    def test_56(self):
        url = weidu.host + '/techApi/group/verify/v1/modifyGroupName'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':12,'groupName':'新群'}
        r = requests.put(url=url, verify=False, headers=headers,data=json)
        print(r.json())

    # 修改群简介
    def test_57(self):
        url = weidu.host + '/techApi/group/verify/v1/modifyGroupDescription'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'groupId': 12, 'description': '新简介'}
        r = requests.put(url=url, verify=False, headers=headers, data=json)
        print(r.json())

    # 解散群组
    def test_58(self):
        url = weidu.host + '/techApi/group/verify/v1/disbandGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'groupId': 12}
        r = requests.delete(url=url, verify=False, headers=headers, data=json)
        print(r.json())

    # 查询我创建的群组
    def test_59(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupsByUserId'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False, headers=headers)
        print(r.json())

    # 查询我所有加入的群组
    def test_60(self):
        url = weidu.host + '/techApi/group/verify/v1/findUserJoinedGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        r = requests.get(url=url, verify=False, headers=headers)
        print(r.json())

    # 查询群组内所有用户信息
    def test_61(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupMemberList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 查询群组详细信息
    def test_62(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupInfo'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 发送群信息
    def test_63(self):
        url = weidu.host + '/techApi/group/verify/v1/sendGroupMessage'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':2,'content':'你们好','chatImage':'我是加密后的图片信息'}
        r = requests.post(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 查询群聊天内容
    def test_64(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupChatRecordPage'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':2,'page':1,'count':5}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 判断用户是否已在群内
    def test_65(self):
        url = weidu.host + '/techApi/group/verify/v1/whetherInGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 申请进群
    def test_66(self):
        url = weidu.host + '/techApi/group/verify/v1/applyAddGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1,'remark':'我是彭于晏'}
        r = requests.post(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 批量邀请加群
    def test_68(self):
        url = weidu.host + '/techApi/group/verify/v1/batchInviteAddGroup'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1,'receiverUid':[18,17]}
        r = requests.post(url=url, verify=False, headers=headers,data=json)
        print(r.json())
# 查询群通知记录
    def test_69(self):
        url = weidu.host + '/techApi/group/verify/v1/findGroupNoticePageList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'page':1,'count':5}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 审核群申请
    def test_70(self):
        url = weidu.host + '/techApi/group/verify/v1/reviewGroupApply'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'noticeId':1,'flag':1}
        r = requests.put(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 退群
    def test_71(self):
        url = weidu.host + '/techApi/group/verify/v1/retreat'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'groupId':1}
        r = requests.delete(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # banner展示列表
    def test_72(self):
        url = weidu.host + '/techApi/information/v1/bannerShow'
        r = requests.get(url=url, verify=False)
        print(r.json())

    # 所有板块查询
    plateId=""
    def test_73(self):
        url = weidu.host + '/techApi/information/v1/findAllInfoPlate'
        r = requests.get(url=url, verify=False)
        print(r.json())
        weidu.plateId=r.json()['result'][0]['id']
        print(weidu.plateId)
    # 资讯推荐展示列表(包含单独板块列表展示)
    zxidd = ""
    def test_74(self):
        url = weidu.host + '/techApi/information/v1/infoRecommendList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'plateId':weidu.plateId,'page':1,"count":5}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())
        weidu.zxidd = r.json()['result'][0]['id']
        print(weidu.zxidd)
# 资讯详情展示

    def test_75(self):
        url = weidu.host + '/techApi/information/v1/findInformationDetails'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'id':weidu.zxidd}
        r = requests.get(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 资讯点赞
    def test_76(self):
        url = weidu.host + '/techApi/information/verify/v1/addGreatRecord'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json={'infoId':weidu.zxid}
        r = requests.post(url=url, verify=False, headers=headers,params=json)
        print(r.json())

    # 取消点赞
    def test_77(self):
        url = weidu.host + '/techApi/information/verify/v1/cancelGreat'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'infoId': weidu.zxid}
        r = requests.delete(url=url, verify=False, headers=headers, params=json)
        print(r.json())

    # 资讯用户评论
    def test_78(self):
        url = weidu.host + '/techApi/information/verify/v1/addInfoComment'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'content':'不错','infoId': weidu.zxid}
        r = requests.post(url=url, verify=False, headers=headers, params=json)
        print(r.json())
# 查询资讯评论列表
#
    def test_79(self):
        url = weidu.host + '/techApi/information/v1/findAllInfoCommentList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'infoId': weidu.zxid,'page':1,'count':5}
        r = requests.get(url=url, verify=False, headers=headers, params=json)
        print(r.json())
        # 根据标题模糊查询
    def test_80(self):
        url = weidu.host + '/techApi/information/v1/findInformationByTitle'

        json = {'title': '哈哈哈','page':1,'count':5}
        r = requests.get(url=url, verify=False,  params=json)
        print(r.json())

# 根据作者名模糊查询
    def test_81(self):
        url = weidu.host + '/techApi/information/v1/findInformationBySource'

        json = {'source': '砍柴','page':1,'count':5}
        r = requests.get(url=url, verify=False,  params=json)
        print(r.json())

    # 资讯广告
    def test_82(self):
        url = weidu.host + '/techApi/information/v1/findInfoAdvertising'

        json = {'source': '砍柴', 'page': 1, 'count': 5}
        r = requests.get(url=url, verify=False, params=json)
        print(r.json())

# 资讯积分兑换
    def test_83(self):
        url = weidu.host + '/techApi/information/verify/v1/infoPayByIntegral'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'infoId': weidu.zxid, 'integralCost':10}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 社区列表
    def test_84(self):
        url = weidu.host + '/techApi/community/v1/findCommunityList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'page': 1, 'count':10}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 发布帖子
    def test_85(self):
        url = weidu.host + '/techApi/community/verify/v1/releasePost'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'content': "这是我发的", 'file':'adada'}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())
        # 查询用户发布的帖子
    communityId=""
    def test_86(self):
        url = weidu.host + '/techApi/community/verify/v1/findUserPostById'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'fromUid': weidu.userId, 'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())
        # weidu.communityId=str(r.json()['result'][0]['id'])

    # 点赞
    def test_87(self):
        url = weidu.host + '/techApi/community/verify/v1/addCommunityGreat'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'communityId':20}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 取消点赞
    def test_88(self):
        url = weidu.host + '/techApi/community/verify/v1/cancelCommunityGreat'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'communityId':20}
        r = requests.delete(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 社区评论列表（标签方式返参
    def test_89(self):
        url = weidu.host + '/techApi/community/v1/findCommunityCommentList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'communityId':20,'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 社区用户评论列表（bean方式返参）
    def test_90(self):
        url = weidu.host + '/techApi/community/v1/findCommunityUserCommentList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'communityId':20,'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())

    # 社区评论
    def test_91(self):
        url = weidu.host + '/techApi/community/verify/v1/addCommunityComment'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'communityId':20,'content':666}
        r = requests.post(url=url, verify=False, params=json,headers=headers)
        print(r.json())


# 我的帖子
    def test_92(self):
        url = weidu.host + '/techApi/community/verify/v1/findMyPostById'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())

# 查询用户发布的帖子
    def test_93(self):
        url = weidu.host + '/techApi/community/verify/v1/findUserPostById'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'fromUid':weidu.userId2,'page':1,'count':5}
        r = requests.get(url=url, verify=False, params=json,headers=headers)
        print(r.json())
# 查询所有会员商品
    spid=""
    def test_94(self):
        url = weidu.host + '/techApi/tool/v1/findVipCommodityList'
        r = requests.get(url=url, verify=False)
        print(r.json())
        weidu.spid=r.json()['result'][0]['commodityId']
    #
    # 用户购买VIP
    def test_95(self):
        url = weidu.host + '/techApi/tool/verify/v1/buyVip'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'commodityId':weidu.spid,'sign':'asdad'}
        r = requests.post(url=url, verify=False, data=json,headers=headers)
        print(r.json())

    # 意见反馈
    def test_96(self):
        url = weidu.host + '/techApi/tool/verify/v1/recordFeedBack'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'content':"hhh"}
        r = requests.post(url=url, verify=False, data=json,headers=headers)
        print(r.json())

    # 查询新版本
    def test_97(self):
        url = weidu.host + '/techApi/tool/v1/findNewVersion'
        # headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'ak':"hhh"}
        r = requests.get(url=url, verify=False, data=json)
        print(r.json())

# 抽奖
    def test_99(self):
        url = weidu.host + '/techApi/tool/verify/v1/lottery'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        # json = {'content': "hhh"}
        r = requests.post(url=url, verify=False,headers=headers)
        print(r.json())

    # 查询用户抽奖记录
    def test__100(self):
        url = weidu.host + '/techApi/tool/verify/v1/findLotteryRecordList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'page': 1,'count':55}
        r = requests.get(url=url, verify=False,headers=headers,params=json)
        print(r.json())

#查询用户系统通知
    def test__102(self):
        url = weidu.host + '/techApi/tool/verify/v1/findSysNoticeList'
        headers = {'userId': weidu.userId, 'sessionId': weidu.sessionId}
        json = {'page': 1,'count':5}
        r = requests.get(url=url, verify=False,headers=headers,params=json)
        print(r.json())

#执行
if __name__ == '__main__':
    unittest.main()
